//
//  CityInfoModel.m
//  O2Cat
//
//  Created by xiabin on 15/12/29.
//  Copyright © 2015年 QiDao.Purifier. All rights reserved.
//

#import "CityInfoModel.h"
#import "ServerCodecDef.h"

@implementation CityInfoModel

+(id)modelwithDic:(NSDictionary *)dict {
    CityInfoModel *info = [[self alloc] init];

    info.pm25 = [dict[kCityPM25] floatValue];
    info.temp = [dict[kCityTemp] floatValue];
    info.wet = [dict[kCityWet] floatValue];
    
    return info;
}

-(NSDictionary*)toDictionary {
    NSMutableDictionary *tmpDic = [[NSMutableDictionary alloc] init];
    
    [tmpDic setObject:[NSNumber numberWithFloat:_pm25] forKey:kCityPM25];
    [tmpDic setObject:[NSNumber numberWithFloat:_temp] forKey:kCityTemp];
    [tmpDic setObject:[NSNumber numberWithFloat:_wet] forKey:kCityWet];
    
    return tmpDic;
}

@end
